package	com.sdry.web.controller.tdd.receiveTips;
import java.util.List;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;

import net.sf.json.JSONObject;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.sdry.model.tdd.receiveTips.ReceiveTips;
import com.sdry.service.tdd.receiveTips.ReceiveTipsService;
import com.sdry.utils.ResponseUtil;
/**
 *
 *@ClassName: ReceiveTipsController
 *@Description: 收货一定时间未上架
 *@Author tdd
 *@Date 2019-09-12 14:19:05
 *@version 1.0
*/
@Controller
@RequestMapping("/receiveTips")
public class ReceiveTipsController{
	@Resource ReceiveTipsService receiveTipsService;
	/** 
	 * 进入页面
	 * @param model
	 * @return 页面路径
	*/
	@RequestMapping("/page")
	public String pageReceiveTips (Model model) {
		return "/td/receiveTips";
	}
	
	/** 
	 * 条件分页查询
	 * @param param 实体条件
	 * @param response
	 * @throws Exception
	*/
	@RequestMapping("/list")
	public void list(ReceiveTips param,HttpServletResponse response) throws Exception{
		/*
		 * 条件分页查询内容
		 */
		List<ReceiveTips> list = receiveTipsService.findPageByMution(param);
		/*
		 * 条件查询总条数
		 */
		Integer total = receiveTipsService.selectCountByMution(param);
		/*
		 * 转为json数据传至页面
		 */
		//创建result
		JSONObject jsonObject = new JSONObject();
		//添加入jsonObject
		jsonObject.put("code", 0);
		jsonObject.put("rows", list);
		jsonObject.put("total", total);
		ResponseUtil.write(response, jsonObject);
	}
}
